<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Proceeds extends Model
{
    public function paytype()
    {
        return $this->hasOne(Payment::class,'id','payment')->field('id,name');
    }

    public function school()
    {
        return $this->hasOne(School::class,'id','school_id')->field('id,name');
    }

    public function admin()
    {
        return $this->hasOne(Admins::class,'id','admin_id')->bind(['username']);
    }

    public function student()
    {
        return $this->hasOne(Student::class,'id','student_id')->bind(['student_number'=>'number']);
    }

    public function invoice()
    {
        return $this->hasOne(Student::class,'id','student_id')->bind(['invoice_number'=>'number']);
    }
}
